const Router = require('koa-router');
const {UserValidator,UserinfoValidator,crpytPassword,verifyLogin} = require('../middleware/user.middleware')
const {auth} = require('../middleware/auth.middleware')
const router = new Router({prefix:'/users'});

const {register,login,setpossword} = require('../controller/user.controller')

//注册接口
router.post('/register',UserValidator,UserinfoValidator,crpytPassword,register)
//登录接口
router.post('/login',UserValidator,verifyLogin,login)
//修改密码接口
router.post('/',auth,crpytPassword,setpossword)


module.exports = router